COM BASSFX Library - Copyright  2020-2022 3delite. All rights reserved.
========================================================================

What's the point?
=================

COM BASSFX Library is an audio file processor COM class wrapper around BASS and BASS_FX, for use in Win32 and Win64 (Windows XP/Vista/7/8/10/11) software.

Features:

- Process various audio file formats BASS supports like MP3, Opus, FLAC, Ogg Vorbis and WAV format with 20 BASS_FX effects:
- COM class is usable by developer environments/platforms supporting COM classes like VBScript or Delphi
- Delphi header file and VBScript tutorials included

Effects and filters supported:

- Volume
- Echo
- Peaking equalizer
- Dynamic amplification
- Auto wah
- Phaser
- Chorus
- Compressor
- Pitch shift
- Reverb
- Low pass filter
- High pass filter
- Band pass filter
- Notch filter
- All pass filter
- Low shelf filter
- High shelf filter
- Rotate
- Tempo
- Reverse


Requirements:
=============

Developer environment/platform supporting COM classes.


Latest Version
==============

The latest version of COM BASSFX Library can always be found at 3delite's website:

	https://www.3delite.hu/Object%20Pascal%20Developer%20Resources/COMBASSFXLibrary.html


Sample Display Library in freeware, shareware and commercial software?
======================================================================

You can use this component in your free programs with a freeware license (non-money-making use). If like it and use it for shareware or commercial (or any other money making - advertising, in app. selling, etc.) you need a shareware or commercial license:

Freeware License: 15, for usage of the component in an unlimited number of your freeware software.

	http://www.shareit.com/product.html?productid=300998631
	
Shareware License: 25, for usage of the component in an unlimited number of your shareware software.

	http://www.shareit.com/product.html?productid=300998632

Commercial License: 95, for usage of the component in a single commercial product.

	http://www.shareit.com/product.html?productid=300998630

For the shareware license, the product must sell for no more than 40 each. The price limit can be raised by purchasing duplicate licences, eg. 2 licences doubles it.

With commercial license the source code (Delphi 10.4 Sydney) is available upon request.

You also need a separate license for BASS from http://www.un4seen.com/.

In all other cases there are no royalties to pay, and you can use all future updates without further cost, all you need to do is just obtain the newest version.

This component is also available as part of the "All Components Lifetime License Bundle" (https://www.3delite.hu/Object%20Pascal%20Developer%20Resources/register.html).

If none of these licenses match your requirements, or if you have any questions, get in touch (3delite@3delite.hu).


Installation:
=============

Run an elevated command prompt, change dir into the folder where 'COMBASSFX.dll' is located, run the following: "regsvr32 COMBASSFX.dll". This should register the COM class. Do this for the desired Win32 and/or Win64 version.
bass.dll, bassenc.dll and bass_fx.dll is needed on the search path, eg. beside your .exe (or VBScript file), or copy the needed DLLs to \Windows\System32\ (Win64 DLLs on a 64 bit OS) and/or \Windows\SysWOW64\ (Win32 DLLs on a 64 bit OS) folder. If the OS is 32 bit then copy the needed DLLs to \Windows\System32\ (from the Win32 folder).
To use the library in VBScript, on a 64 bit OS, the VBScript process is 64 bit so the needed DLLs have to be from the Win64 folder, beside the .VBS file or in the System32 folder as written above.


Usage:
======

After registering the DLL it can be accessed like:

    createobject("COMBASSFX.BASSFX")
    
VBScript usage example, add echo + silence:

	option explicit
	dim myobject
	set myobject = createobject("COMBASSFX.BASSFX")
	myobject.FreeBASS 0
	myobject.OpenFile "Test1.wav"
	myobject.AppendSilence 5.0 'this call needs to be before adding/setting FXs (in seconds)
	myobject.AddEcho 0.999, 0.999, 0.7, 0.50, 1, -1, 0 'add here as many effects as needed
	myobject.SaveFile "Test1Processed.wav", ""
	myobject.CloseFile
	set myobject = nothing
	
The SaveFile() function's last parameters:

	-32bitfloat
	-32bitinteger
	-24bitinteger
	-16bitinteger
	-8bitinteger
	-noRF64
	-noWFEXT

These specify the generated WAV file's properties.


HResult error codes:
====================

S_OK: Success.
S_FALSE: Unknown error occured or catastrophic failure.
3: bass.dll could not be loaded.
9: Input file could not be opened.
10: Output file could not be created.
E_INVALIDARG: Parameters specified are invalid.


BASS COM Management:
====================

BASSCOMManagement.dll first must be registered before using it, please see 'Installation' section.

BASS COM Management class should be used when running the COM classes in a multi-threded environment and using COM BASSFX Library together with for example BASS Encoder Library.
The individual components don't know of each other's state and they are both using BASS. To overcome this issue 'BASSCOMManagement.BASSManagement' COM class should be used when starting the process to initialize BASS for all the COM classes.
There are only 2 functions: 'BASSInitialize' and 'BASSFree'. 'BASSInitialize' expects only one parameter, the audio device number, it should be '0', the COM classes need to have BASS initialized for 0, the "no sound device".
When starting the process use:

	option explicit
	dim myobject
	set myobject = createobject("BASSCOMManagement.BASSManagement")
	myobject.BASSInitialize 0
	set myobject=nothing

And just before the process exits call:

	option explicit
	dim myobject
	set myobject = createobject("BASSCOMManagement.BASSManagement")
	myobject.BASSFree
	set myobject=nothing
	
The state is stored globally per process, and is valid until unloading the 'BASSCOMManagement.dll' from the process. Also the initialization and free calls are reference counted.

A simpler solution is to never free BASS - BASS will free itself when the BASS.dll is unloaded anyway. Use 'FreeBASS(1)' to set it to free it when freeing the COM BASSFX class. The default state is '0'.

When not using a scripting language it's only needed to call BASS_Init() manually (with device '0') on your program startup, and BASS_Free() on program exit, directly with BASS.dll.


Copyright, Disclaimer, and all that other jazz
==============================================

This software is provided "as is", without warranty of ANY KIND, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. The author shall NOT be held liable for ANY damage to you, your computer, or to anyone or anything else, that may result from its use, or misuse. Basically, you use it at YOUR OWN RISK.

Usage of COM BASSFX Library indicates that you agree to the above conditions.

You may freely distribute the COM BASSFX Library package as long as NO FEE is charged and all the files remain INTACT AND UNMODIFIED.

All trademarks and other registered names contained in the COM BASSFX Library package are the property of their respective owners.

Please donate to the author of BASS_FX if you are using BASS_FX for commercial purposes.


Bug reports, Suggestions, Comments, Enquiries, etc...
=====================================================

If you have any of the aforementioned please email:

3delite@3delite.hu


History
=======

1.0.4.4 01/12/2020
------------------
First release.

1.0.5.8 10/12/2020
------------------
* Fixed Win32 version "AppendSilence()" function
